//			$(document).ready(function () {
////				arrears();
//			})			

			//清空顾客信息
			function clearsj(){
				window.location.reload();
			}

			//获取顾客信息
			function searchCus()
			{	
				var reData=getCusInfo();
				if(reData.msg==200)
				{
					var url1='/bturnClass/getLcByCus';
					var data1={"customerIds":reData.customer.ids};
			//		var divid="havaLc_div";
					var divid="lcInfo_div";
					common_ajax.ajaxDiv(divid,url1,data1);
					arrears();
					var total=$('#newTotal').val();
					var oldTotal=$('#havaLcTotal').val();
					var receivable=total-oldTotal;
			    	$('#receivable').numberbox('setValue',receivable);
			    	$('#proceeds').numberbox('setValue',receivable);
			    	$('#arrears').numberbox('setValue',0);
				}
			}
			$(document).keydown(function(event){ 
				if(event.keyCode == 13){
					getCusInfo();
				} 
			}); 
			function  arrears()
			{	
				$("#proceeds").numberbox({
					onChange: function (n,o) {
						var receivable=$('#receivable').val();
						var proceeds=$('#proceeds').val();
						$('#arrears').numberbox('setValue',receivable-proceeds);
					}
				})
			}
			
			function  jiesuan()
			{	
				
				var hybh=$('#customerHybh').textbox("getValue");
				
				var name=$('#customerName').val();
				var phone=$('#customerPhone').val();
				if(hybh != "" || nama != "" || phone != "")
				{
					var url='/bturnClass/jiesuan';
					var data=$('#newLc_form').serialize();
					var reData = common_ajax.ajaxFunc(url,data);
					if(reData == "200")
					{
						 $.slideMsg("保存成功", parent.$);
						 parent.refresh();
					}else
					{
						$.alert(parent.$, reData);
					}
				}else
				{
					$.alert(parent.$, "顾客身份信息部能为空，请输入顾客身份信息！！");
				}
			}
			
			